/**
* @name: 文档导出
 * @param: excelName 导出文件名
 * @param: api 导出接口
 * @param: params 接口入参
 */

export const exportFn = async (excelName, api, params) => {
    const res = await api(params)
    const link = document.createElement('a')
    let blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
    link.style.display = 'none'
    link.href = URL.createObjectURL(blob)
    link.download = excelName
    document.body.appendChild(link)
    link.click()
    document.body.removeChild(link)
}
